//
//  CinemaCell.m
//  12.30_homework_豆瓣电影MVC
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "CinemaCell.h"

@implementation CinemaCell

- (void)dealloc {
    [_imgView release];
    [_cinemaName release];
    [_address release];
    [_telephone release];
    [_MyCinemaName release];
    [_MyAddress release];
    [_MyTelephone release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatCell];
    }
    return self;
}

- (void)creatCell {
    
    self.imgView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgView];
    [_imgView release];
    
    self.cinemaName = [[UILabel alloc] init];
    [_imgView addSubview:_cinemaName];
    [_cinemaName release];
    
    self.address = [[UILabel alloc] init];
    [_imgView addSubview:_address];
    [_address release];
    
    self.telephone = [[UILabel alloc] init];
    [_imgView addSubview:_telephone];
    [_telephone release];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _imgView.frame = CGRectMake(20, 20, self.contentView.frame.size.width - 40, 170);
    _imgView.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    
    _cinemaName.frame = CGRectMake(20, 20, _imgView.frame.size.width - 40, 30);
    
    _address.frame = CGRectMake(20, 60, _imgView.frame.size.width - 40, 60);
    _address.numberOfLines = 0;
    _address.lineBreakMode = NSLineBreakByClipping;
    
    _telephone.frame = CGRectMake(20, 120, _imgView.frame.size.width - 40, 30);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
